﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessPlatformTool.BusinessObjectStructure
{
    internal class Fields : List<IField>, IFields
    {
        public IField New()
        {
            IField field = new Field();
            this.Add(field);
            return field;
        }
        public IList<IField> GetPrimaryKey()
        {
            return this.FindAll(item => item.IsPrimaryKey == true);
        }
        public IList<IField> GetUnionKey()
        {
            return this.FindAll(item => item.IsUnionKey == true);
        }
        public IList<IField> GetDefaultValueFields()
        {
            return this.FindAll(item => string.IsNullOrWhiteSpace(item.DefaultValue) == false);
        }
    }
}
